import request from '@/utils/request'

const approve = {
  // 待我审批记录
  myApproveList(params) {
    return request.get('/kjxm/approve/myApproveList', {
      params
    })
  },
  // 我已审批记录
  myApprovedList(params) {
    return request.get('/kjxm/approve/myApprovedList', {
      params
    })
  },
  // 审批操作
  opApprove(data) {
    return request.post('/kjxm/approve/approve', data);
  },
  // 根据业务id获取该业务所有审批记录
  getByBusinessId(businessId) {
    return request.get(`/kjxm/approve/getByBusinessId/${businessId}`);
  },
  // 审批人员列表
  getApproverList(params) {
    return request.get('/kjxm/approveUser/list', { params })
  },
  // 添加形式审查人员
  addApprover(data) {
    // return request.post('/kjxm/approveUser/add', data)
    return request.post('/system/user/registerReview', data)
  },
  delApprover(id) {
    return request.post(`/kjxm/approveUser/delete/${id}`)
  },
  // 形式审查项目列表
  getApproverReviewList(params) {
    return request.get(`/kjxm/approve/reviewList`, {
      params
    })
  },
  getApproverReviewAllList(params) {
    return request.get(`/kjxm/approve/reviewAllList`, {
      params
    })
  },
  getApproverReviewAllList2(params) {
    return request.get(`/kjxm/project/xsReviewList`, {
      params
    })
  },
  addReviewProject(data){
    return request.post('/kjxm/approve/addReviewProject', data)
  },
  ApproveUserProjectGetByUserId(id){
    return request.get(`/kjxm/approve/getByUserId/${id}`);
  },
  ApproveaddReviewUser(data){
    return request.post(`/kjxm/approve/addReviewUser`, data);
  },
  ApproveGetByProjectId(id){
    return request.get(`/kjxm/approve/getByProjectId/${id}`);
  },
  reviewApprove(data){
    return request.post(`/kjxm/approve/reviewApprove`,data);
  },
  getApproverReviewByUserId(id) {
    return request.get(`/kjxm/project/xsReview/getByUserId/${id}`)
  },
  getXsscByBusinessId(businessId) {
    return request.get(`/kjxm/approve/getXsscByBusinessId/${businessId}`);
  },
  exportExcel(userId) {
    return request.get(`/kjxm/excel/xsReview/getByUserId/${userId}`);
  },
  xsscProjectList() {
    return request.get(`/kjxm/excel/xsscProjectList`);
  }
}

export default approve;
